3.347 \(\int \frac {3+\sec (c+d x)}{2-\sec (c+d x)} \, dx\)

Optimal. Leaf size=87 \[ -\frac {5 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sqrt {3} \sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 \sqrt {3} d}+\frac {5 \log \left (\sqrt {3} \sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 \sqrt {3} d}+\frac {3 x}{2} \]

[Out]

3/2*x-5/6*ln(cos(1/2*d*x+1/2*c)-sin(1/2*d*x+1/2*c)*3^(1/2))/d*3^(1/2)+5/6*ln(cos(1/2*d*x+1/2*c)+sin(1/2*d*x+1/
2*c)*3^(1/2))/d*3^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3919, 3831, 2659, 207} \[ -\frac {5 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sqrt {3} \sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 \sqrt {3} d}+\frac {5 \log \left (\sqrt {3} \sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 \sqrt {3} d}+\frac {3 x}{2} \]

Antiderivative was successfully verified.

[In]

Int[(3 + Sec[c + d*x])/(2 - Sec[c + d*x]),x]

[Out]

(3*x)/2 - (5*Log[Cos[(c + d*x)/2] - Sqrt[3]*Sin[(c + d*x)/2]])/(2*Sqrt[3]*d) + (5*Log[Cos[(c + d*x)/2] + Sqrt[
3]*Sin[(c + d*x)/2]])/(2*Sqrt[3]*d)

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 3831

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a*Sin[e
 + f*x])/b), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 3919

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(c*x)/a,
x] - Dist[(b*c - a*d)/a, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0]

Rubi steps

\begin {align*} \int \frac {3+\sec (c+d x)}{2-\sec (c+d x)} \, dx &=\frac {3 x}{2}+\frac {5}{2} \int \frac {\sec (c+d x)}{2-\sec (c+d x)} \, dx\\ &=\frac {3 x}{2}-\frac {5}{2} \int \frac {1}{1-2 \cos (c+d x)} \, dx\\ &=\frac {3 x}{2}-\frac {5 \operatorname {Subst}\left (\int \frac {1}{-1+3 x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{d}\\ &=\frac {3 x}{2}-\frac {5 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sqrt {3} \sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 \sqrt {3} d}+\frac {5 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sqrt {3} \sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 \sqrt {3} d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.10, size = 39, normalized size = 0.45 \[ \frac {9 (c+d x)+10 \sqrt {3} \tanh ^{-1}\left (\sqrt {3} \tan \left (\frac {1}{2} (c+d x)\right )\right )}{6 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(3 + Sec[c + d*x])/(2 - Sec[c + d*x]),x]

[Out]

(9*(c + d*x) + 10*Sqrt[3]*ArcTanh[Sqrt[3]*Tan[(c + d*x)/2]])/(6*d)

________________________________________________________________________________________

fricas [A]  time = 0.46, size = 84, normalized size = 0.97 \[ \frac {18 \, d x + 5 \, \sqrt {3} \log \left (-\frac {2 \, \cos \left (d x + c\right )^{2} + 2 \, {\left (\sqrt {3} \cos \left (d x + c\right ) - 2 \, \sqrt {3}\right )} \sin \left (d x + c\right ) + 4 \, \cos \left (d x + c\right ) - 7}{4 \, \cos \left (d x + c\right )^{2} - 4 \, \cos \left (d x + c\right ) + 1}\right )}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3+sec(d*x+c))/(2-sec(d*x+c)),x, algorithm="fricas")

[Out]

1/12*(18*d*x + 5*sqrt(3)*log(-(2*cos(d*x + c)^2 + 2*(sqrt(3)*cos(d*x + c) - 2*sqrt(3))*sin(d*x + c) + 4*cos(d*
x + c) - 7)/(4*cos(d*x + c)^2 - 4*cos(d*x + c) + 1)))/d

________________________________________________________________________________________

giac [A]  time = 0.32, size = 58, normalized size = 0.67 \[ \frac {9 \, d x - 5 \, \sqrt {3} \log \left (\frac {{\left | -2 \, \sqrt {3} + 6 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}{{\left | 2 \, \sqrt {3} + 6 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}}\right ) + 9 \, c}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3+sec(d*x+c))/(2-sec(d*x+c)),x, algorithm="giac")

[Out]

1/6*(9*d*x - 5*sqrt(3)*log(abs(-2*sqrt(3) + 6*tan(1/2*d*x + 1/2*c))/abs(2*sqrt(3) + 6*tan(1/2*d*x + 1/2*c))) +
 9*c)/d

________________________________________________________________________________________

maple [A]  time = 0.84, size = 39, normalized size = 0.45 \[ \frac {5 \sqrt {3}\, \arctanh \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {3}\right )}{3 d}+\frac {3 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((3+sec(d*x+c))/(2-sec(d*x+c)),x)

[Out]

5/3/d*3^(1/2)*arctanh(tan(1/2*d*x+1/2*c)*3^(1/2))+3/d*arctan(tan(1/2*d*x+1/2*c))

________________________________________________________________________________________

maxima [A]  time = 1.11, size = 80, normalized size = 0.92 \[ -\frac {5 \, \sqrt {3} \log \left (-\frac {\sqrt {3} - \frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}}{\sqrt {3} + \frac {3 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}}\right ) - 18 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3+sec(d*x+c))/(2-sec(d*x+c)),x, algorithm="maxima")

[Out]

-1/6*(5*sqrt(3)*log(-(sqrt(3) - 3*sin(d*x + c)/(cos(d*x + c) + 1))/(sqrt(3) + 3*sin(d*x + c)/(cos(d*x + c) + 1
))) - 18*arctan(sin(d*x + c)/(cos(d*x + c) + 1)))/d

________________________________________________________________________________________

mupad [B]  time = 2.30, size = 26, normalized size = 0.30 \[ \frac {3\,x}{2}+\frac {5\,\sqrt {3}\,\mathrm {atanh}\left (\sqrt {3}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{3\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(1/cos(c + d*x) + 3)/(1/cos(c + d*x) - 2),x)

[Out]

(3*x)/2 + (5*3^(1/2)*atanh(3^(1/2)*tan(c/2 + (d*x)/2)))/(3*d)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ - \int \frac {\sec {\left (c + d x \right )}}{\sec {\left (c + d x \right )} - 2}\, dx - \int \frac {3}{\sec {\left (c + d x \right )} - 2}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3+sec(d*x+c))/(2-sec(d*x+c)),x)

[Out]

-Integral(sec(c + d*x)/(sec(c + d*x) - 2), x) - Integral(3/(sec(c + d*x) - 2), x)

________________________________________________________________________________________